package titan.wizards.importTitanProject;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
import titan.messages.Messages;

/**
 *  Wizard to import to Eclipse a Titan project
 */
public class ImportProjectWizard extends Wizard implements IImportWizard {
	ImportProjectPage importProjectPage;

	public ImportProjectWizard() {
		importProjectPage = new ImportProjectPage();
	}

	/**
	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
	 */
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		//do nothing
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean performFinish() {
		return importProjectPage.importProject();
	}

	/**
	 * {@inheritDoc}
	 */
	public void addPages() {
		addPage(importProjectPage);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean canFinish() {
		return importProjectPage.canFinish();
	}

	/**
	 * {@inheritDoc}
	 */
	public String getWindowTitle() {
		return new String(Messages.ImportTitanProject);
	}
}